<extend name="Base/common" />

<block name="style">
    <!-- 引入css -->
    <load  href ="__CSS__/account/personAddr.css"/>
    <load  href ="__CSS__/account/city-picker.css"/>
    <load  href ="__CSS__/account/common.css"/>
    <load  href ="__CSS__/account/r3common.css"/>
    <load  href ="__CSS__/account/checkout.css"/>
    <!-- 引入js -->
    <load  href ="__JS__/account/jquery-1.10.2.min.js"/>
    <load  href ="__JS__/account/arvato_touch.js"/>
    <load  href ="__JS__/account/jquery.js"/>
    <load  href ="__JS__/account/city-picker.data.js"/>
    <load  href ="__JS__/account/city-picker.js"/>
</block>

<block name="body">
    <!-- 头部订单面包屑 -->
    <div class="addCartOverlay"></div>
    <div class="checkoutBcBox cf">
        <div class="wrapper">
            <span class="cur"><em>1</em>填写订单</span>
            <span class=""><em>2</em>订单确认</span>
            <span class="checkComplete"><em>3</em>支付订单</span>
        </div>
    </div>

    <div class="sticky_proxy" style="height:6px;">&nbsp;</div>
    <!--start login & register -->
    <div class="checkoutBox">
        <!--start wrapper min-width:950px-->
        <div class="wrapper cf">
            <!--start left aside col4-1-->
            <div class="col4-1">
                <!-- 地址表单  -->
                <form action="__SELF__" method="post" id="co-shipping-form"  name="form1"   class="yan-chekcout">
                    <h3 class="font24">配送地址</h3>
                    <!-- 收货人 -->
                    <div class="w200 ">
                        <div class="commonInputBox">
                            <input type="text" class="textInput commonInput required" id="shipping_firstname" name="shipping[firstname]" placeholder="* 收货人" value="">
                        </div>
                    </div>
                    <input type="hidden" id="shipping_country_id" class="validate-select" name="shipping[country_id]" value="CN">
                    <div class="mt20 shipAddrSelect cf">
                        <div class="copySelect" id="shipping_region_div">
                            <div class="mydiv" style="padding:0;height:47px;width:500px;">
                                <!-- 全国三级联动js开始 -->
                                <div id="distpicker" style="width:40px;">
                                  <!-- <div class="form-group"> -->
                                    <div style="position: relative;">
                                      <input id="city-picker3" name="area" class="form-control" readonly type="text" data-toggle="city-picker">
                                    </div>
                                  <!-- </div> -->
                                </div>
                                <!-- 全国三级联动 -->
                            </div>
                        </div>
                    <!--end other select-->
                    </div>
                    <!-- 详细地址 -->
                    <div class="w500 mt20">
                        <div class="commonInputBox">
                            <input type="text" placeholder="* 详细地址" name="shipping[street][]" id="shipping_street1" value="" class="textInput commonInput required">
                        </div>
                    </div>
                    <!-- 邮编 -->
                    <div class="w200 mt20">
                        <div class="commonInputBox">
                        <input type="text" placeholder="* 邮编" name="shipping[postcode]" id="shipping_postcode" value="" class="textInput commonInput required">
                        </div>
                    </div>
                    <!-- 电话 -->
                    <div class="w500 shipTel cf mt20">
                        <div class="commonInputBox fl w160">
                            <input type="text" name="shipping[mobile]" value="" placeholder="* 手机" class="textInput commonInput  mobile" id="shipping_mobile">
                        </div>
                        <div class="fl fixTelTxt">或 固定电话</div>
                        <div class="commonInputBox fl w65">
                            <input type="text" name="shipping[tel_areacode]" value="" class="textInput commonInput areacode" id="shipping_tel_areacode">
                        </div>
                        <div class="fl fixTelSpilt">-</div>
                        <div class="commonInputBox fl w160">
                            <input type="text" name="shipping[telephone]" value="" class="textInput commonInput telephone" id="shipping_telephone">
                        </div>
                    </div>
                    <input type="hidden" name="shipping[save_in_address_book]" value="1" id="shipping_save_in_address_book">
                    <input type="hidden" name="shipping[use_for_shipping]" value="1" id="shipping_use_for_shipping">
                    <input type="hidden" name="shipping[update_region]" value="0" id="shipping_update_region">
                    <input type="hidden" id="shipping[primary_shipping]" name="shipping[primary_shipping]" value="1">
                    <input type="hidden" id="shipping[primary_billing]" name="shipping[primary_billing]" value="1">
                    <input type="hidden" value="" id="baseurl">
                    <script type="text/javascript" src="__JS__/account/validate.js"></script>
                    <!--start shipping address info-->

                    <!-- 送货备注 -->
                    <div class="w500 mt20"> <span class="checkoutInputTit">送货备注</span>
                    <div class="commonInputBox">
                    <textarea class="textareaInput commonInput" title="送货备注" name="shipping[delivery_memo]" rows="5" cols="45" id="shipping_delivery_memo"></textarea>
                    </div>
                    <span class="shipAdrRemarkTip">请限制在120字数以内</span>
                    </div>
                    <!--end shipping address info-->
                    <div style="margin-top:11px;">
                        <input type="hidden" id="shipping[id]" name="shipping[id]" value="">
                        <input type="hidden" id="shipping_yancheckout_page" name="shipping[yancheckout_page]" value="1">

                        <div class="checkoutConfirm">
                            <a href="javascript:;" class=" btnCommon btnBlueLinear btnArrow w200 fl" id="save_address" >保存地址<em></em></a>
                        </div>
                    </div>
                    <!--start payment-->
                    <div class="deliveryM borderTop updataClassAdress">
                        <h3 class="font24">配送方式</h3>
                        <div class="checkStock radioBionic  cf radioEvent">
                            <p class="deliveryT1 delivery_typep cf" style="font-weight:normal"> <b>普通快递</b>  完成订单支付后48小时内安排发货。
                                <span class="radio-view " >
                                    <em id="checksend"></em>
                                    <input name="delivery_type" type="radio">
                                </span>
                            </p>
                        </div>
                    </div>
                    <input type="hidden" name="token">
                    <!--start payment-->
                    <div class="integral borderTop">
                        <h3 class="font24">积分</h3>
                        <div class="checkoutGoTwo w500 checkStock checkBox radioBionic cf radioEvent">
                            <p class="fl">
                                <span><b> &nbsp;&nbsp;使用积分抵扣:</b> <em class="colorMidBlue">50</em> 积分 ( <em class="colorMidBlue">50 积分 (¥5.00)</em> ) </span>
                                <span class="radio-view " >
                                    <em id="checkintegral"></em>
                                    <input name="delivery_type" type="radio">
                                </span>
                            </p>
                            <a href="" class="moreIntegral fl">查看详情</a>
                        </div>
                    </div>
                    <!-- 支付方式 -->
                    <div class="checkPaymentBox borderTop">
                        <h3 class="font24">支付方式</h3>
                        <div id="payment-lists">
                            <div class="checkStock radioBionic  cf radioEvent">
                                <p class="alipay  bankpay">
                                    <span><img src="__IMG__/account/logo_alipay.jpg" alt="支付宝"></span>
                                    <span class="radio-view" id="abb">
                                        <em class="alibabapay" id="zhifubao"></em>
                                        <input id="p_method_bank_ALIPAY" value="ALIPAY" checked="checked" name="payment[alipay_pay_bank]" title="支付宝" type="radio">
                                    </span>
                                </p>
                                <foreach  name="data" item="val">
                                    <p class="bankpay"><span><img src="__IMG__/account/{$val['image']}" alt="{$val['name']}"></span>
                                    <span class="radio-view checkpay">
                                        <em class="payway"></em>
                                        <input  name="payment[alipay_pay_bank]" title="{$val['name']}" type="radio">
                                    </span></p>
                                </foreach>
                            </div>
                            <!--end payment-->
                            <input id="p_method_alipay_payment_paymethod" value="bankPay" type="hidden" name="payment[alipay_pay_method]">
                            <input name="shipping_method" type="hidden" value="carrier_bestway" id="s_method_tablerate" class="input">
                        </div>
                    </div>

                    <!--end invoice inof-->
                    <div class="mt60 checkoutConfirm" style="margin-top: 20px;">
                        <span>亲爱的顾客，adidas官方旗舰店仅通过外拨客服电话021-25256040与您进行沟通，任何其他形式（如手机、QQ、非官方客服账号）的沟通，包括首位0开头的0-4008801515电话均为诈骗信息，请勿轻信，以免造成财产损失。
                        </span>
                       <br><br>
                        <a href="javascript:document.form1.submit();" title="确认下单" id="comfirm_order" class="btnCommon btnBlueLinear btnArrow w200 fl">确认下单<em></em></a>
                        <!-- <input type="submit" name="" value="确认提价 "> -->
                        <a href="{:U('Cart/showcart')}" title="返回购物车修改" class="checkoutContinue fl">返回购物车修改</a>
                    </div>
                    <!--end go next step btn-->
                </form>
            </div>
            <!--end left aside col4-1-->
            <!--start right aside col4-->
            <div class="col4 last">
                <div class="loginBox">
                    <h3>登录</h3>
                    <div class="contentBox">
                        <div class="welcome">欢迎光临，<span>王培恩</span></div>
                    </div>
                </div>
                <div class="orderSummary">
                    <h3>订单摘要：<small>共4件</small></h3>
                    <div class="contentBox">
                        <div class="item">
                            商品总额 <span>¥3396.00</span>
                        </div>
                        <div class="item">
                            优惠总额 <span>¥0.00</span>
                        </div>
                        <div class="item delivery">
                            运费 <span id="item_shipping_fee">¥0.00</span>
                        </div>
                        <div class="item total">
                            商品总计<span>¥3396.00</span>
                        </div>
                        <div class="proList">
                            <ul>
                                <li>
                                    <div class="img">
                                        <img src="__IMG__/account/21_874.jpg">
                                    </div>
                                    <div class="text">
                                        <p class="name">跑步 男子 ch Rocket m 跑步鞋 1号黑色 BA8672</p>
                                        <p class="info">BA8672</p>
                                        <p class="info">颜色：黑</p>
                                        <p class="info">尺码： 41    </p> <br>
                                        <p class="price">2x <span>¥1,099</span></p>
                                        <p class="price">小计: <span>¥2,198</span></p>
                                    </div>
                                </li>
                                <li>
                                    <div class="img">
                                        <img src="__IMG__/account/e1_844.jpg">
                                    </div>
                                    <div class="text">
                                        <p class="name">训练 男子 紧身运动长裤 黑 S94388</p>
                                        <p class="info">S94388</p>
                                        <p class="info">颜色：黑</p>
                                        <p class="info">尺码： S </p> <br>
                                        <p class="price">2x <span>¥599</span></p>
                                        <p class="price">小计: <span>¥1,198</span></p>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="infoBox">
                    <h4>帮助？</h4>
                    <a href="">关于订单</a><br>
                    <a href="">验收验货</a><br>
                    <a href="">物流配送</a><br>
                    <a href="">售后服务</a>
                </div> &nbsp;
                <div class="infoBox">
                    <h4>我们接受下列付款方式</h4>
                    <img src="__IMG__/account/pay.jpg">
                </div>
            </div>
            <!--end right aside col4-->
        </div>
        <!--end wrapper min-width:950px-->
    </div>
    <!--end login & register -->
    <div class="footBox">
        <!--start #363738 background footer-->
        <div class="footBot">
            <div class="wrapper cf">
                <div class="copyRight">
                    <a href="" title="隐私条款">隐私条款</a>
                    <span>苏ICP备14048805号-1</span>
                    <span>©2016 adidas</span>
                </div>
            </div>
            <!--end wrapper min-width:950px-->
        </div>
        <!--end #363738 background footer-->
    </div>
</block>

<block name="script">
    <!-- 是否需要发票 -->
    <script type="text/javascript">
    $(".checkbill").click(function(){
        $(".bill").toggleClass('cuu');
    });


    // 地址表单提交
    // $("form").submit(function(){
    //     var self = $(this);
    //     alert(self.serialize());
    //     $.post(self.attr("action"), self.serialize(), success, "json");
    //     return false;
    //
    //     function success(data){
    //         alert(data);
    //         if(data.status){
    //             window.location.href = data.url;
    //         } else {
    //             self.find(".submitrespone").text(data.info);
    //             //刷新验证码
    //         }
    //     }
    // });
    </script>

    <script>
        //送货备注
        $(function(){
        $("#shipping_delivery_memo").blur(function(){
            var shipping_delivery_memo = $("#shipping_delivery_memo").val().replace(/\s/g, "");
              var deliveryLength=shipping_delivery_memo.length;
              if (deliveryLength > 120) {
                  $(this).parent('.commonInputBox').find('.errormessage').remove();
                  $(this).parent('.commonInputBox').addClass('errorInput');
                  $(this).parent('.commonInputBox').append('<span class="errormessage">您输入的内容过长</span>');

              }else{
                  if ($(this).parent('.commonInputBox').hasClass('errorInput')) {
                      $(this).parent('.commonInputBox').removeClass('errorInput');
                      $(this).parent('.commonInputBox').find('.errormessage').remove();
                  }
              }
        });
        $("#shipping_delivery_memo").focus(function() {
          if ($(this).parent('.commonInputBox').hasClass('errorInput')) {
              $(this).parent('.commonInputBox').removeClass('errorInput');
              $(this).parent('.commonInputBox').find('.errormessage').remove();
          }
        });
    });
    </script>
    <!-- 支付方式选择 -->
    <script>
        $(".checkpay").click(function(){
            $('.payway').each(function(i){
                $('.payway').eq(i).removeClass('cuu');
            });
            $(this).children().eq(0).toggleClass('cuu');
        });
    </script>

    <!-- 配送方式的选中 -->
    <script type="text/javascript">
        $('.radio-view').click(function(){
            $(this).find("#checksend").toggleClass('cuu');
        })
    </script>
    <!-- 是否使用积分 -->
    <script type="text/javascript">
        $('.radio-view').click(function(){
            $(this).find("#checkintegral").toggleClass('cuu');
        });
    </script>
    <!-- 支付方式 -->
    <script type="text/javascript">
        jQuery(function($){
            var isEnoughPointsToCoverAmount = false;
            $("#use_reward_points").change(function(){
                if($(this).attr("checked")=='checked' && isEnoughPointsToCoverAmount){
                    $('.checkPaymentBox').hide();
                }else{
                    $('.checkPaymentBox').show();
                }
            });
         });

    </script>

    <!-- 支付方式 -->
    <script type="text/javascript">
        $("#abb").click(function(){
            $("#zhifubao").toggleClass('cuu');
        });

    </script>


</block>
